package com.tool4j.common;

import lombok.Getter;

@Getter
public enum ToolTypeEnum {

    CODE("code", "代码模式"),
    CRUD("crud", "Java代码生成器"),
    TRANSLATION("translation", "AI翻译"),
    CONVERSION("conversion", "转换器"),
    ;

    private final String code;

    private final String name;

    ToolTypeEnum(String code, String name) {
        this.name = name;
        this.code = code;
    }

    public static ToolTypeEnum getByCode(String code) {
        for (ToolTypeEnum value : ToolTypeEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
